package com.ly.heart.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ly.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ly.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * 物料分类对象 erp_material_type
 *
 * @author wutao
 * @date 2024-05-24
 */
@TableName("erp_material_type")
@ApiModel(value = "erp_material_type对象", description = "物料分类")
public class MaterialTypeEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 物料分类主键
     */
    @TableId(type = IdType.INPUT)
    private String id;

    /**
     * 分类名称
     */
    @ApiModelProperty("分类名称")
    @TableField("type_name")
    @Excel(name = "分类名称")
    private String typeName;

    /**
     * 父级id
     */
    @ApiModelProperty("父级id")
    @TableField("parent_id")
    @Excel(name = "父级id")
    private String parentId;

    /**
     * 分类层级
     */
    @ApiModelProperty("分类层级")
    @TableField("leave")
    @Excel(name = "分类层级")
    private String leave;


    @ApiModelProperty("相关子集")
    @TableField(exist = false)
    private List<MaterialTypeEntity> treeList = new ArrayList<>();

    /**
     * 删除标识
     */
    private String delFlag;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setLeave(String leave) {
        this.leave = leave;
    }

    public String getLeave() {
        return leave;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public List<MaterialTypeEntity> getTreeList() {
        return treeList;
    }

    public void setTreeList(List<MaterialTypeEntity> treeList) {
        this.treeList = treeList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("typeName", getTypeName())
                .append("parentId", getParentId())
                .append("remark", getRemark())
                .append("leave", getLeave())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("delFlag", getDelFlag())
                .toString();
    }
}
